package com.micro.turtle.model.resp;

import cn.hutool.core.annotation.Alias;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Description: TODO
 * Created by: jason.lv
 * Creation time: 2022/1/21 15:48
 * Modification description:
 * Modified by:
 * Modification time:
 * Version: V1.0
 *
 * @author jason.lv
 * @since 2022/1/21 15:48
 */
@NoArgsConstructor
@Data
public class PipelineResp {

    @Alias("id")
    private Integer id;
    @Alias("iid")
    private Integer iid;
    @Alias("project_id")
    private Integer projectId;
    @Alias("sha")
    private String sha;
    @Alias("ref")
    private String ref;
    @Alias("status")
    private String status;
    @Alias("before_sha")
    private String beforeSha;
    @Alias("tag")
    private Boolean tag;
    @Alias("yaml_errors")
    private Object yamlErrors;
    @Alias("user")
    private UserDTO user;
    @Alias("created_at")
    private String createdAt;
    @Alias("updated_at")
    private String updatedAt;
    @Alias("started_at")
    private Object startedAt;
    @Alias("finished_at")
    private Object finishedAt;
    @Alias("committed_at")
    private Object committedAt;
    @Alias("duration")
    private Object duration;
    @Alias("queued_duration")
    private Double queuedDuration;
    @Alias("coverage")
    private Object coverage;
    @Alias("web_url")
    private String webUrl;

    @NoArgsConstructor
    @Data
    public static class UserDTO {

        @Alias("name")
        private String name;
        @Alias("username")
        private String username;
        @Alias("id")
        private Integer id;
        @Alias("state")
        private String state;
        @Alias("avatar_url")
        private String avatarUrl;
        @Alias("web_url")
        private String webUrl;
    }
}
